package com.free.chat.filter;

import cn.hutool.core.util.StrUtil;
import com.free.chat.common.constant.SysConstant;
import org.noear.solon.annotation.Component;
import org.noear.solon.core.handle.Context;
import org.noear.solon.validation.annotation.Logined;
import org.noear.solon.validation.annotation.LoginedChecker;

/**
 * 判断是否登陆了
 */
// @Component
public class IsLoginFilter implements LoginedChecker {
    @Override
    public boolean check(Logined anno, Context ctx, String userKeyName) {
        return StrUtil.isNotBlank(ctx.header(SysConstant.TOKEN_NAME));
    }
}
